{% extends "base.html" %}

{% block title %}运行任务 - 在线跑批系统{% endblock %}

{% block content %}
<div class="row justify-content-center">
    <div class="col-md-8">
        <div class="card border-primary">
            <div class="card-header bg-primary text-white">
                <h4 class="mb-0"><i class="fas fa-play-circle me-2"></i>确认运行任务</h4>
            </div>
            <div class="card-body">
                <h5 class="card-title">您确定要立即运行任务 <span class="text-primary">{{ task.name }}</span> 吗？</h5>
                <p>此操作将在远程服务器上执行指定的命令。执行时间取决于命令复杂度和服务器响应速度。</p>
                
                <div class="mb-4">
                    <h6><strong>目标服务器：</strong> {{ task.server.name }} ({{ task.server.hostname }})</h6>
                </div>
                
                <div class="mb-4">
                    <h6><strong>执行命令：</strong></h6>
                    <pre class="bg-light p-3 rounded">{{ task.command }}</pre>
                </div>
                
                <form method="post">
                    {% csrf_token %}
                    <div class="d-flex justify-content-between">
                        <button type="submit" class="btn btn-success">
                            <i class="fas fa-play me-1"></i>立即运行
                        </button>
                        <a href="{% url 'task_list' %}" class="btn btn-secondary">
                            <i class="fas fa-times me-1"></i>取消
                        </a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{% endblock %}
